package com.hnucm.ktstudy.base

fun main(){
    val string="lx" plusTo "th"
    println(string)

    //源码 to 就是一个infix函数
//    /**
//     * Creates a tuple of type [Pair] from this and [that].
//     *
//     * This can be useful for creating [Map] literals with less noise, for example:
//     * @sample samples.collections.Maps.Instantiation.mapFromPairs
//     */
//    public infix fun <A, B> A.to(that: B): Pair<A, B> = Pair(this, that)
    val map=mapOf(
        "a" to "B"
    )
    println(map["a"])
}

//infix 语法糖 构建更可读语法
//语法与扩展函数很类似
infix fun String.plusTo(param:String):String{
    return this + param
}